package oop.core.item;
/**
 * @author Hoang Le
 * This class represents all of the weapons of the game
 */


import java.util.*;

import oop.core.entity.Stats;
import oop.core.entity.Occupation;
import oop.core.visitors.*;
/**
 * This represents EquippableItem
 * @author Shinichi
 *
 */

public class EquippableItem extends SellableItem implements UseVisitable
{
	private List<String> occupationNamesList;
	private EquippableItemPosition itemPosition;
	private String equipmentType;
	
	public EquippableItem(String name, String imageID, int price, Stats stats, List<String> occupationList, EquippableItemPosition itemPosition, String equipmentType)
	{
		super(name, imageID, price,stats);
		this.occupationNamesList = occupationList;
		this.itemPosition = itemPosition;
		this.equipmentType = equipmentType;
	}
	
	public List<String> getOccupations(){
		return occupationNamesList;
	}
	public EquippableItemPosition getItemPosition()
	{
		return itemPosition;
	}
	
	public void addOccupation (Occupation o)
	{
		occupationNamesList.add(o.getName());
	}
	
	public boolean hasOccupation(Occupation o)
	{
		boolean ret = occupationNamesList.contains(o.getName());
		return ret;
	}
	
	/**
	 * implement the pickupvisitable so that it can pick up an item
	 * without violating TDA
	 */
	public void accept(PickUpVisitor visitor)
	{
		visitor.visitEquippableItem(this);
	}
	
	/**
	 * implement the uservisitable so that it can pick up an item
	 * without violating TDA
	 */
	public void accept(UseVisitor visitor)
	{
		visitor.visitEquippableItem(this);
	}
	/**
	 * get the type of the equipment
	 * @return
	 */
	public String getEquipmentType()
	{
		return equipmentType;
	}

	public void setEquipmentType(String equipmentType)
	{
		this.equipmentType = equipmentType;
	}
	
}
